<script language="javascript" src="/Public/static/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<div id="main-content">
    <div id="main" class="main">
		<div class="user-hd">
			<h2>影院管理>>{$page_title}</h2>
			<a class="kehu uploadify-button" style="position: absolute;  bottom: 8px; right: 25px;" href="{:U('Cinema/add')}">
			  新增
			</a>
		</div>	
		<div class="clearfix searchspin" style="min-width: 1200px;">
			<dl>
				<dt>筛选条件:</dt>
				<dd>		
				<form action="/Admin/Cinema/cinemaList" method="get">
                    行业：
                    <select name="CopyrightIndustryOptions" class="" style="height:30px; width: 100px;">
                        <option value="0">-</option>
                        <volist name="VideoCopyrightIndustryOptions" id="vo">
                            <if condition="I('get.CopyrightIndustryOptions') eq $i">
                                <option value="{$i}" selected>{$vo}</option>
                                <else/>
                                <option value="{$i}">{$vo}</option>
                            </if>
                        </volist>
                    </select>

                    渠道商：
                    <select name="type_name" class="" style="height:30px;width: 150px;">
                        <option value="0">-</option>
                        <volist name="cinema_type_options" id="vo">
                            <if condition="I('get.type_name') eq $i">
                                <option value="{$i}" selected>{$vo}</option>
                                <else/>
                                <option value="{$i}">{$vo}</option>
                            </if>
                        </volist>
                    </select>

				开通时间：<input type="text" name="create_time_start" id="create_time_start" value="{$_GET['create_time_start']}" class="Wdate bg-input mr5" <literal>onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'create_time_end\')||\'%y-%M-%d\'}'})"</literal> readonly="readonly" size="30" style="width: 90px;"/>
                        <input type="text" name="create_time_end" id="create_time_end" value="{$_GET['create_time_end']}" class="Wdate bg-input mr5" <literal>onfocus="WdatePicker({minDate:'#F{$dp.$D(\'create_time_start\')}',maxDate:'%y-%M-%d'})"</literal> readonly="readonly" size="30" style="width: 90px;" />
                 影院状态：
				<select name="status" class="" style="height:30px; width: 100px;">
				  <option value="0" <eq name="params.status" value="0">selected</eq> >-</option>
				  <option value="1" <eq name="params.status" value="1">selected</eq> >使用中</option>
				  <option value="2" <eq name="params.status" value="2">selected</eq> >停用</option>
				</select>
				服务器状态：
				<select name="hoststatus" class="" style="height:30px; width: 100px;">
				  <option value="0" <eq name="params.hoststatus" value="0">selected</eq> >-</option>
				  <option value="1" <eq name="params.hoststatus" value="1">selected</eq> >正常</option>
				  <option value="2" <eq name="params.hoststatus" value="2">selected</eq> >异常</option>
				</select>					
				<input type="text" maxlength="36" name="keywords" value="{$params['keywords']}" placeholder="主机名称或影院名称..." class="bg-input">
				<a href="{:U('Admin/Cinema/cinemaList')}" class="sblue-btn" style="height:28px;width:68px;">清空 </a>
				<input type="submit" class="sblue-btn" value="检索">
				<input type="hidden" name="id" value="">
				<div class="clear"></div>
				</form>
				</dd>
			</dl>

		</div>		
        <div class="spin-cont">
			<p style="padding-bottom:20px;">
				影院数量：<span class="text_red">{$data_list_data['count']}</span> 家；
				平台自有：<span class="text_red">{$data_list_data['pingcount']}</span> 家；
				代理：<span class="text_red">{$data_list_data['agentcount']}</span> 家；
			</P>	
            <table style="min-width: 1750px;">
                <tr>
                    <th class="spin-tit" style="width: 160px;">主机名</th>
                    <th class="spin-tit" style="width: 160px;">影院名称</th>
                    <th style="width: 130px;">开通时间</th>
					<th style="width: 180px;">授权结束日期</th>
					<th style="width: 180px;">行业</th>
                    <th style="width: 160px;">所属代理</th>
					<th style="width: 120px;">渠道商</th>
					<!--<th style="width: 180px;">计费模式</th>-->
					<th style="width: 80px;">是否试用</th>
                    <!--<th style="width: 66px;">付款状态</th>-->
					<th style="width: 116px;">系统版本</th>
                    <th style="width: 88px;">是否正式启用</th>
                    <!--<th style="width: 100px;">是否正式启用</th>-->
					<th style="width: 128px;">实际幕数/签约幕数</th>
					<th style="width: 70px;">连接状态</th>
                    <th style="width: 270px;">操作</th>
                </tr>
                <volist name="data_list_data[data_list]" id="vo">
                <tr>
                    <td class="spin-tit">{$vo.host_name}</td> <!--主机名-->
                    <td class="spin-tit">
						<if condition="4 EQ $vo[type]">
							小帅
							<elseif condition="8 EQ $vo[type]"/>
							携旅
							<elseif condition="9 EQ $vo[type]"/>
							耀莱
							<elseif condition="10 EQ $vo[type]"/>
							迈智威
							<elseif condition="11 EQ $vo[type]"/>
							1905
							<else/>
							{$vo.cinema_name|default='--'}
						</if>
					</td>   <!--影院名称-->
                    <td>{$vo.join_time|date='Y-m-d', ###}</td>  <!--开通时间-->
					<td>
						<gt name="vo['accredit_day_end']" value="0">
							{$vo.accredit_day_end|date="Y-m-d",###}
							<else/>
							--
						</gt>
					</td>  <!--授权结束时间-->
					<td>{$vo.video_copyright_industry|default='--'}</td> <!--行业-->
                    <td>{$agent_options[$vo[agent_id]]|default="平台直属影院"}</td> <!--所属代理-->
					<td>{$vo.type_name}</td>  <!--渠道商-->
                    <!--<td>-->
						<!--计费模式-->
					<!--</td> &lt;!&ndash;计费模式&ndash;&gt;-->
                    <td>
                    <eq name="vo['is_try']" value="1">
						<font color="green">是</font>
						<else/>
						<font color="red">否</font>
					</eq>
					</td> <!--是否试用-->
					<td>
						<eq name="vo['system_platform']" value="1">
							1905数娱 {$vo.versions}
							<else/>
							1905 {$vo.versions}
						</eq>
					</td> <!--系统版本-->
					<td>
						<if condition="2 EQ $vo[is_online]">
							<font color="red">否</font>
							<else />
							<font color="green">是</font>
						</if>
					</td> <!--服务器状态-->
                    <td>
						{$vo.video_hall_count}/{$vo.buy_hall_count}
					</td> <!--实际幕数-->
					<td>
						<?php if(1800 < $current_time - $vo[refresh_time]):?>
						<font color="red">异常</font>
						<?php else:?>
						<font color="green">正常</font>
						<?php endif;?>
					</td>	 <!--使用状态-->
                    <td>
                        <if condition="1 EQ $vo[power_status]">
                            <a href="javascript:;" onclick="updateCinemaUser('{:U("Cinema/update", array("id"=>$vo[id], "power_status"=>2))}', '是否确定停用该用户？')" class="delfilebtn" >停用</a>
                        <else/>
                            <a href="javascript:;" onclick="updateCinemaUser('{:U("Cinema/update", array("id"=>$vo[id], "power_status"=>1))}', '是否确定启用该用户？')" class="delfilebtn" >启用</a>
                        </if>
                        &nbsp; | &nbsp;
                        <a href="javascript:;" onclick="initPassword('{:U("Cinema/initPassword", array("id"=>$vo[id]))}', '是否初始化密码？')" class="delfilebtn" >密码初始化</a>
                        <if condition="0 LT $vo[recharge_method_id]">
<!--                         &nbsp; | &nbsp;
                        <a href="{:U('Cinema/recharge', array('id'=>$vo[id]))}" class="delfilebtn" >充值</a> -->
                        </if>
                        &nbsp; | &nbsp;
                        <a href="{:U('Cinema/edit', array('id'=>$vo[id]))}" class="delfilebtn" >编辑</a>
                        &nbsp; | &nbsp;
                        <a href="{:U('Cinema/detail', array('id'=>$vo[id]))}" class="delfilebtn" >详情</a>
                    </td>
                </tr>
                </volist>
            </table>
            <div class="page txt-center">
                {$data_list_data.pager}
            </div>
        </div>
        <div style="height: 50px; line-height: 50px; border-bottom: solid 1px #ccc; border-top: solid 1px #ccc; text-align: center; font-size: 14px;">
            <label>系统版本号：</label>
            <span style="color: #08c">V1.0</span>
            <div class="clear"></div>
        </div>
    </div>
</div>
<script language="javascript">
    function initPassword(url, message)
    {
        swal({
            title: message,
            text: "",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#0C7AB9",
            cancelButtonText: "取消",
            confirmButtonText: "确定",
            closeOnConfirm: false
            },
            function(){
                $.ajax({
                    type:'post',
                    dataType:'json',
                    url: url,
                    success:function(data){
                        if (data.status==1) {
                            alertMessage(data.info, 1, 2);
                            if (data.url) {
                                delayGoToPage(data.url, 2000);
                            }
                        }else{
                            alertMessage(data.info, '', 2);
                        }
                    }
                });
            }
        );
    }
</script>